import request from '@/utils/request'

// 查询缴费列表
export function listPay(query) {
  return request({
    url: '/payment/pay/list',
    method: 'get',
    params: query
  })
}

// 查询缴费详细
export function getPay(id) {
  return request({
    url: '/payment/pay/' + id,
    method: 'get'
  })
}

// 新增缴费
export function addPay(data) {
  return request({
    url: '/payment/pay',
    method: 'post',
    data: data
  })
}

// 修改缴费
export function updatePay(data) {
  return request({
    url: '/payment/pay',
    method: 'put',
    data: data
  })
}

// 删除缴费
export function delPay(id) {
  return request({
    url: '/payment/pay/' + id,
    method: 'delete'
  })
}

// 2025-09-24: 根据房间号和楼栋名称获取业主ID
export function getUserIdByRoomNoAndBuildingName(roomNo, buildingName) {
  return request({
    url: `/payment/pay/getUserIdByRoomNoAndBuildingName/${roomNo}/${buildingName}`,
    method: 'get'
  })
}
